package com.zit.java.controller;

import com.zit.java.pojo.Account;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;


public class BaseController {
    public  static  final String SESSIONOBJ = "SESSIONACC";
    /**
     * 所有controller的父类
     * @param servletRequest
     * @return
     */
    public static Account getLoginAcc(HttpServletRequest servletRequest) {
        HttpSession session = servletRequest.getSession();
        Account acc = (Account) session.getAttribute(SESSIONOBJ);

        return acc;
    }
}
